-- Decompiled with the Synapse X Luau decompiler.
local RunService = game:GetService("RunService")
local IsClient = RunService:IsClient();
local CommonOHOH = _G.CommonOHOH;
local v3 = CommonOHOH.load.OHOHConnection();
CommonOHOH.enum.UpdateType = {};
CommonOHOH.enum.UpdateType.logic = true;
CommonOHOH.enum.UpdateType.step = true;
CommonOHOH.enum.UpdateType.heart_beat = true;
CommonOHOH.enum.UpdateType.first = true;
CommonOHOH.enum.UpdateType.input = true;
CommonOHOH.enum.UpdateType.camera = true;
CommonOHOH.enum.UpdateType.character = true;
CommonOHOH.enum.UpdateType.last = true;
CommonOHOH.enum.UpdateType.render = true;
local M = CommonOHOH.class.new(script);
local ObjectManager = CommonOHOH.load.ObjectManager();
function M.ctor(p1)
	ObjectManager:AddObject(p1);
end;
local CallBackManager = CommonOHOH.load.CallBackManager();
local InstanceManager = CommonOHOH.load.InstanceManager();
function M.dtor(self)

	self:DelMainInst()

	ObjectManager:DelObject(self);

	CallBackManager:DelObject(self);

	InstanceManager:DelObject(self);

end;
local function ClassIsEqual(p3, p4)
	if p3.class == p4 then
		return true;
	end;
	if not p3.super then
		return false;
	end;
	return ClassIsEqual(p3.super, p4);
end;
function M.IsA(p5, p6)
	return ClassIsEqual(p5, p6);
end;
function M.AddProcess(self, fuc, ...)
	return CallBackManager:AddProcess("logic", self, fuc, ...);
end;
function M.AddUpdate(p9, p10, p11, ...)
	return CallBackManager:AddUpdate("logic", p9, p10, p11, ...);
end;
function M.AddStepProcess(p12, p13, ...)
	return CallBackManager:AddProcess("step", p12, p13, ...);
end;
function M.AddStepUpdate(p14, p15, p16, ...)
	return CallBackManager:AddUpdate("step", p14, p15, p16, ...);
end;
function M.AddHeartBeatProcess(p17, p18, ...)
	return CallBackManager:AddProcess("heart_beat", p17, p18, ...);
end;
function M.AddHeartBeatUpdate(p19, p20, p21, ...)
	return CallBackManager:AddUpdate("heart_beat", p19, p20, p21, ...);
end;
if IsClient then
	function M.AddRenderProcess(p22, p23, p24, ...)
		return CallBackManager:AddProcess(p23, p22, p24, ...);
	end;
	function M.AddRenderUpdate(p25, p26, p27, p28, ...)
		return CallBackManager:AddUpdate(p26, p25, p27, p28, ...);
	end;
end;
function M.WaitForFunc(p29, p30, ...)
	local v6 = { p30(...) };
	p29:CoCheck();
	return table.unpack(v6);
end;
function M.Wait(p31, p32)
	return CallBackManager:Wait(p31, p32);
end;
function M.WaitForChild(p33, p34)
	assert(p34, "param path is nil");
	assert(p33.main_inst, p33.class .. " don't have main inst");
	return CommonOHOH:GetPath(p34, p33.main_inst);
end;
function M.WaitForChild_Check(p35, p36)
	assert(p36, "param path is nil");
	assert(p35.main_inst, p35.class .. " don't have main inst");
	return CommonOHOH:GetPath_Check(p36, p35.main_inst);
end;
function M.WaitForChild_Loop(p37, p38)
	assert(p38, "param path is nil");
	assert(p37.main_inst, p37.class .. " don't have main inst");
	return CommonOHOH:GetPath_Loop(p38, p37.main_inst);
end;

local u8 = {
	__index = function(p39, p40)
		return p39.__inst:GetAttribute(p40);
	end, 
	__newindex = function(p41, p42, p43)
		p41.__inst:SetAttribute(p42, p43);
	end
};
function M.SetMainInst(self, inst)
	assert(inst, "Instance can't be nil");
	if self.main_inst then
		InstanceManager:DelInst(self.main_inst);
	end;
	self.main_inst = inst;
	InstanceManager:AddInst(self, inst);
	self.attribute = setmetatable({
		__inst = inst, 
		__rbx = {}
	}, u8);
	if IsClient then
		self.attribute.client_class = self.class;
		return;
	end;
	self.attribute.server_class = self.class;
end;

function M.DelMainInst(self)
	if self.main_inst then
		InstanceManager:DelInst(self.main_inst);
	end;
	if self.attribute then
		for v7, v8 in pairs(self.attribute.__rbx) do
			v7:Disconnect();
		end;
	end;
	self.main_inst = nil;
	self.attribute = nil;
end;
function M.AttributeValueChanged(self, key, fuc, ...)
	assert(key, "param key is nil");
	assert(fuc, "param handle is nil");
	local ObjectManager0 = { ... };
	return CallBackManager:AddRbxConnect(self, self.attribute.__inst:GetAttributeChangedSignal(key), function()
		fuc(self, table.unpack(ObjectManager0));
	end);
end;
function M.AttributeChanged(self, fuc, ...)
	assert(fuc, "param handle is nil");
	local ObjectManager1 = { ... };
	return CallBackManager:AddRbxConnect(self, self.attribute.__inst.AttributeChanged, function(p52)
		fuc(self, p52, table.unpack(ObjectManager1));
	end);
end;
function M.IsExist(p53)
	return ObjectManager:IsObjectExsit(p53);
end;

function M.ExistCheck(p54)
	if not p54:IsExist() then
		coroutine.yield();
	end;
end;
function M.InitObjAsset(p55, p56)
	if not RunService:IsStudio() then
		CommonOHOH.LoadAsset(p56)
	end
end

function M.AddCo(p55, p56)
	return CallBackManager:AddCo(p55, "logic", p56);
end;
function M.AddCoTo(p57, p58, p59)
	return CallBackManager:AddCo(p57, p58, p59);
end;
function M.CoCheck(p60, p61)
	CallBackManager:CoCheck(p60, p61);
end;
return M;
